home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / elk-2_0.lha / elk-2.0 / examples / xaw / grip < prev    next >
Encoding:
Text File  |  1991-09-26  |  551 b   |  24 lines

  1. ;;; -*-Scheme-*-
  2. ;;;
  3. ;;; Grip widget demo
  4.  
  5. (require 'xwidgets)
  6. (load-widgets shell grip)
  7.  
  8. (define top (application-initialize 'grip))
  9. (set-values! top 'width 50 'height 50)
  10.  
  11. (define g (create-managed-widget (find-class 'grip) top))
  12.  
  13. (augment-translations g
  14. "   <Btn1Down>:      GripAction(press)
  15.     <Btn1Motion>:    GripAction(move)
  16.     <Btn1Up>:        GripAction(release,done)")
  17.  
  18. (add-callback g 'callback
  19.   (lambda (w x)
  20.     (format #t "Action: ~s    Event: ~s~%" (cdr x) (caar x))))
  21.  
  22. (realize-widget top)
  23. (context-main-loop (widget-context top))
  24.